Bivariate - MA Data Analysis

Correlation b/w dependent vars.(food loss and food waste)

## # A tibble: 3 × 4
##   rowname         food_waste_kg liquid_waste_kg solid_waste_kg
## * <chr>                   <dbl>           <dbl>          <dbl>
## 1 food_waste_kg            1               0.97           0.88
## 2 liquid_waste_kg          0.97            1              0.73
## 3 solid_waste_kg           0.88            0.73           1
##                 food_waste_kg liquid_waste_kg solid_waste_kg
## food_waste_kg    0.000000e+00   9.849303e-100   5.265564e-52
## liquid_waste_kg 9.849303e-100    0.000000e+00   2.938486e-28
## solid_waste_kg   5.265564e-52    2.938486e-28   0.000000e+00

Correlation b/w independent vars.

## # A tibble: 9 × 10
##   rowname   temp_c humi_p prcp_mm  fulls  halfs takeouts customers liquors sales
## * <chr>      <dbl>  <dbl>   <dbl>  <dbl>  <dbl>    <dbl>     <dbl>   <dbl> <dbl>
## 1 temp_c     1      0.094  -0.035  0.25   0.094    0.11      0.24    0.066  0.27
## 2 humi_p     0.094  1       0.35  -0.043 -0.15    -0.03     -0.065  -0.23  -0.11
## 3 prcp_mm   -0.035  0.35    1     -0.19  -0.097   -0.087    -0.16   -0.18  -0.16
## 4 fulls      0.25  -0.043  -0.19   1      0.33     0.15      0.92    0.33   0.8 
## 5 halfs      0.094 -0.15   -0.097  0.33   1        0.19      0.62    0.15   0.5 
## 6 takeouts   0.11  -0.03   -0.087  0.15   0.19     1         0.2     0.2    0.54
## 7 customers  0.24  -0.065  -0.16   0.92   0.62     0.2       1       0.32   0.84
## 8 liquors    0.066 -0.23   -0.18   0.33   0.15     0.2       0.32    1      0.46
## 9 sales      0.27  -0.11   -0.16   0.8    0.5      0.54      0.84    0.46   1
##           temp_c humi_p prcp_mm  fulls  halfs takeouts customers liquors  sales
## temp_c    0.0000 0.2340  0.6566 0.0015 0.2362   0.1621    0.0024  0.4023 0.0006
## humi_p    0.2340 0.0000  0.0000 0.5850 0.0528   0.7066    0.4098  0.0028 0.1738
## prcp_mm   0.6566 0.0000  0.0000 0.0165 0.2214   0.2744    0.0386  0.0247 0.0445
## fulls     0.0015 0.5850  0.0165 0.0000 0.0000   0.0614    0.0000  0.0000 0.0000
## halfs     0.2362 0.0528  0.2214 0.0000 0.0000   0.0135    0.0000  0.0579 0.0000
## takeouts  0.1621 0.7066  0.2744 0.0614 0.0135   0.0000    0.0118  0.0132 0.0000
## customers 0.0024 0.4098  0.0386 0.0000 0.0000   0.0118    0.0000  0.0000 0.0000
## liquors   0.4023 0.0028  0.0247 0.0000 0.0579   0.0132    0.0000  0.0000 0.0000
## sales     0.0006 0.1738  0.0445 0.0000 0.0000   0.0000    0.0000  0.0000 0.0000

Correlation b/w independent vars.

## # A tibble: 6 × 7
##   rowname   temp_c humi_p prcp_mm customers liquors sales
## * <chr>      <dbl>  <dbl>   <dbl>     <dbl>   <dbl> <dbl>
## 1 temp_c     1      0.094  -0.035     0.24    0.066  0.27
## 2 humi_p     0.094  1       0.35     -0.065  -0.23  -0.11
## 3 prcp_mm   -0.035  0.35    1        -0.16   -0.18  -0.16
## 4 customers  0.24  -0.065  -0.16      1       0.32   0.84
## 5 liquors    0.066 -0.23   -0.18      0.32    1      0.46
## 6 sales      0.27  -0.11   -0.16      0.84    0.46   1
##                temp_c       humi_p      prcp_mm    customers      liquors
## temp_c    0.000000000 2.340014e-01 6.565817e-01 2.439128e-03 4.022764e-01
## humi_p    0.234001450 0.000000e+00 5.743318e-06 4.097823e-01 2.795016e-03
## prcp_mm   0.656581713 5.743318e-06 0.000000e+00 3.857002e-02 2.466598e-02
## customers 0.002439128 4.097823e-01 3.857002e-02 0.000000e+00 3.121698e-05
## liquors   0.402276407 2.795016e-03 2.466598e-02 3.121698e-05 0.000000e+00
## sales     0.000633642 1.738069e-01 4.451900e-02 1.320143e-44 5.456896e-10
##                  sales
## temp_c    6.336420e-04
## humi_p    1.738069e-01
## prcp_mm   4.451900e-02
## customers 1.320143e-44
## liquors   5.456896e-10
## sales     0.000000e+00
## Correlation computed with
## • Method: 'pearson'
## • Missing treated using: 'pairwise.complete.obs'

Principal Component Analysis

## Standard deviations (1, .., p=6):
## [1] 214.732100   7.765591   3.696578   3.444734   1.566496   1.184341
## 
## Rotation (n x k) = (6 x 6):
##                    PC1         PC2         PC3          PC4          PC5
## customers -0.040159987  0.65415860  0.53926876  0.003558498  0.060251895
## fulls     -0.029860294  0.54164943 -0.15786373  0.636260658  0.041233236
## halfs     -0.007547398  0.08289829  0.54937299 -0.489499360  0.050317942
## takeouts  -0.015212980 -0.51993282  0.60713716  0.592751376  0.096986947
## liquors   -0.003971133 -0.01596434 -0.11378519 -0.060061003  0.991282881
## sales     -0.998594698 -0.03514675 -0.02991606 -0.024260491 -0.009455986
##                     PC6
## customers  0.5253664932
## fulls     -0.5237131815
## halfs     -0.6701632001
## takeouts   0.0078888164
## liquors    0.0230916594
## sales     -0.0006150708
## Standard deviations (1, .., p=3):
## [1] 11.97351  9.37176  1.99279
## 
## Rotation (n x k) = (3 x 3):
##                PC1        PC2         PC3
## temp_c  0.19339715  0.9809830  0.01643034
## humi_p  0.97919789 -0.1919432 -0.06579745
## prcp_mm 0.06139248 -0.0288136  0.99769772

Scatter Plot

FW with temp

FW with humidity

FW with precipitation

FW with customers

FW with sales

FW with liquor

Correlogram

Cross-Correlation